package xyz.second.common.exception.handler;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import xyz.second.common.exception.ResponsiveException;

@RestControllerAdvice
public class ResponsiveExceptionHandler {

    @ExceptionHandler(ResponsiveException.class)
    public ResponseEntity<String> handleResponsiveException(ResponsiveException exception) {
        return new ResponseEntity<>(exception.getMessage(), exception.getHttpStatus());
    }

}
